package LeetCode;

public class MaxArea {
  
  
  //slow!!
  public int maxArea(int[] height) {
    // Start typing your Java solution below
    // DO NOT write main() function
    int result = 0;
    
    for(int i = 0 ; i < height.length; i++){
      for(int j = i+1; j < height.length; j++){
        int v = (j-i) * Math.min(height[i], height[j]);
        if(v > result)
          result = v;
      }
    }
    
    
    return result;
  }   

  /**
   * @param args
   */
  public static void main(String[] args) {
    // TODO Auto-generated method stub

  }

}
